import React from 'react'
import { NavBar, Icon } from 'antd-mobile';
import { useHistory } from 'react-router-dom';

// 封装的navBar 组件
export default ({ value }) => {
  const history = useHistory();
  return (
    <NavBar
      mode="dark"
      icon={<Icon type="left" />}
      style={{ opacity: 0.8, backgroundColor: "rgb(228, 153, 144)" }}
      onLeftClick={() => { history.goBack() }}
      rightContent={[
        <Icon key="0" type="search" style={{ marginRight: '16px' }} />
      ]}
    >{value}</NavBar>
  )
}